home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Talking Telnet / source / init / iNetwork.c next >
Text File  |  1996-06-22  |  2KB  |  60 lines

  1. /*
  2. *    iNetwork.c
  3. *    General network initialization routines
  4. *    Called only by init.c
  5. *
  6. *****************************************************************
  7. *    NCSA Telnet for the Macintosh                                *
  8. *                                                                *
  9. *    National Center for Supercomputing Applications                *
  10. *    Software Development Group                                    *
  11. *    152 Computing Applications Building                            *
  12. *    605 E. Springfield Ave.                                        *
  13. *    Champaign, IL  61820                                        *
  14. *                                                                *
  15. *    Copyright (c) 1986-1993,                                    *
  16. *    Board of Trustees of the University of Illinois                *
  17. *****************************************************************
  18. *  Revisions:
  19. *  7/92        Telnet 2.6:    Initial version.  Jim Browne
  20. */
  21.  
  22. #ifdef MPW
  23. #pragma segment INIT
  24. #endif
  25.  
  26. #include "iNetwork.proto.h"
  27.  
  28. #include "InternalEvents.h"
  29. #include "network.proto.h"            // For Mnetinit proto
  30. #include "netevent.proto.h"            // For Stask & setblocksize proto
  31. #include "bkgr.proto.h"                // For StartUpFTP proto
  32. extern QHdr        gEventsQueue, gEventsFreeQueue;
  33. extern short    gQueueLength;
  34.  
  35. /*************************************************************************/
  36. /* neteventinit
  37. *  load up the pointers for the event queue
  38. *  makes a circular list to follow, required for error messages
  39. */
  40. void neteventinit( void)
  41. {
  42.     gEventsFreeQueue.qHead = 0;
  43.     gEventsFreeQueue.qTail = 0;
  44.     gEventsFreeQueue.qFlags = 0;
  45.     gEventsQueue.qHead = 0;
  46.     gEventsQueue.qTail = 0;
  47.     gEventsQueue.qFlags = 0;
  48.     
  49.     ChangeQueueLength(NEVENTS);
  50.     gQueueLength = NEVENTS;
  51. }
  52.  
  53. /* initnet - init all of the network stuff... */
  54. void initnet( void)
  55. {
  56.     neteventinit();                            /* initializes for error messages to count */
  57.     networkUPPinit();        //initialize UPP's for TCP callbacks
  58.     Mnetinit();
  59.     StartUpFTP();
  60. }